package com.zmn.plat.services.impl.extension.serv.category.group;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zmn.plat.model.entity.extension.serv.category.group.ExtensionServCategoryGroup;
import com.zmn.plat.model.entity.extension.serv.category.group.ExtensionServCategoryGroupQuery;
import com.zmn.plat.model.vo.extension.serv.category.group.ExtensionServCategoryGroupVO;
import com.zmn.plat.persistence.interfaces.extension.serv.category.group.ExtensionServCategoryGroupDao;
import com.zmn.plat.services.interfaces.extension.serv.category.group.ExtensionServCategoryGroupService;

@Service
public class ExtensionServCategoryGroupServiceImpl implements ExtensionServCategoryGroupService {

    @Resource
    ExtensionServCategoryGroupDao extensionServCategoryGroupDao;

    @Override
    public ExtensionServCategoryGroup findByKey(Integer groupId) {
        return extensionServCategoryGroupDao.findByKey(groupId);
    }

    @Override
    public List<ExtensionServCategoryGroupVO> listPageByQuery(ExtensionServCategoryGroupQuery query) {
        int count = countByQuery(query);
        query.setTotalCount(count);
        return extensionServCategoryGroupDao.listPageByQuery(query);
    }

    @Override
    public List<ExtensionServCategoryGroupVO> listByQuery(ExtensionServCategoryGroupQuery query) {
        return extensionServCategoryGroupDao.listByQuery(query);
    }

    @Override
    public List<ExtensionServCategoryGroup> listAll() {
        return extensionServCategoryGroupDao.listAll();
    }

    @Override
    public Integer countByQuery(ExtensionServCategoryGroupQuery query) {
        return extensionServCategoryGroupDao.countByQuery(query);
    }

    @Override
    public Integer updateByKey(ExtensionServCategoryGroup extensionServCategoryGroup) {
        return extensionServCategoryGroupDao.updateByKey(extensionServCategoryGroup);
    }

    @Override
    public Integer insert(ExtensionServCategoryGroup extensionServCategoryGroup) {
        return extensionServCategoryGroupDao.insert(extensionServCategoryGroup);
    }

    @Override
    public Integer insertBatch(List<ExtensionServCategoryGroup> list) {
        return extensionServCategoryGroupDao.insertBatch(list);
    }

    @Override
    public Integer deleteByKey(Integer groupId) {
        return extensionServCategoryGroupDao.deleteByKey(groupId);
    }

    @Override
    public Integer deleteByServCategId(Integer servCategId) {
        return extensionServCategoryGroupDao.deleteByServCategId(servCategId);
    }
}